<template>
<div id='lesson' v-for="(lesson,index) in lessons" :key="index">
  <span :class="{show:lesson.show}">{{lesson.title}}</span>
  <button @click="lesson.show = !lesson.show">{{lesson.show?'取消':'删除'}}</button>
</div>
</template>

<script>
import lessons from '../../data/lessons'
export default {
  data() {
    return {
      lessons
    }
  },
}
</script>

<style>
#lesson {
  display:flex;
  margin: 0 auto;
  width: 300px;
  justify-content:space-between;
  background-color: aqua;
}
.show {
  background-color: red;
  text-decoration: line-through;
}
</style>